<template>
  <div class="home">
    <h2>电商后台管理</h2>
    <div class="left">

         
           <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#545c64"
            text-color="#fff"
            router
            active-text-color="#ffd04b">
            <el-submenu index="1" width='100%'>
            <template slot="title">
           <i class="el-icon-location"></i>
           <span>用户管理</span>
           </template>
          <el-menu-item index="add" :route="{path:'/add'}" >用户列表</el-menu-item>
          </el-submenu>
          </el-menu>

          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#545c64"
            text-color="#fff"
            router
            active-text-color="#ffd04b">
            <el-submenu index="1" width='100%'>
            <template slot="title">
           <i class="el-icon-menu"></i>
           <span>权限管理</span>
           </template>
          <el-menu-item index="from" :route="{path:'/from'}" >权限列表</el-menu-item>
          </el-submenu>
          </el-menu>

          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            router
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
            <el-submenu index="1" width='100%'>
            <template slot="title">
           <i class="el-icon-location"></i>
           <span>商品管理</span>
           </template>
          <el-menu-item index="mag" :route="{path:'/mag'}" >商品列表</el-menu-item>
          </el-submenu>
          </el-menu>

          <el-menu
            default-active="2"
            router
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
            <el-submenu index="1" width='100%'>
            <template slot="title">
           <i class="el-icon-setting"></i>
           <span>订单管理</span>
           </template>
          <el-menu-item index="name" :route="{path:'/name'}">订单列表</el-menu-item>
          </el-submenu>
          </el-menu>

          
      </div>
    <div class="right">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  mounted() {},
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
  components: {},
};
</script>

<style lang='scss'>
.left {
  width: 300px;
  float: left;
  height: 600px;
  background-color: #313743;
}
.right{
  float: left;
}
</style>
